package com.example.chat.service.impl;

import com.example.chat.enums.Code;
import com.example.chat.pojo.res.ResModel;
import com.example.chat.service.CommonService;
import com.example.chat.util.UploadPicUtils;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

@Service
public class CommonServiceImpl implements CommonService {

    /**
     * 上传头像
     * @param file
     * @return
     */
    public ResModel upload(MultipartFile file) {
        String s = UploadPicUtils.uploadPicture(file);
        return ResModel.success(Code.SUCCESS,s);
    }
}
